Log In  
[back to top]

[ :: Read More :: ]

Cart #46976 | 2017-12-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

Made for Ludum Dare. It’s 2 minutes before the deadline, I need some sleep now.

P#46977 2017-12-03 20:59 ( Edited 2017-12-10 16:02)

[ :: Read More :: ]

Cart #chamber-1 | 2021-04-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
47

A mini adventure game.

This cartridge extensively abuses Lua memory, lossy zlib compression, data-stored-in-code, and dget to render a 600×252 image with pixel-perfect scrolling. This is more a tech demo but I ended up doing a full mini game for Ludum Dare 37.

I’ll write a postmortem to explain all the hacks.

P#33420 2016-12-12 22:29 ( Edited 2021-04-06 19:13)

[ :: Read More :: ]

This function abuses Unicode and ANSI color codes to output a screenshot of the current screen to a text terminal such as xterm. You can record the PICO-8 rendering and replay it using “cat”! You can run PICO-8 over ssh! You can be anything you want.

I also set up a telnet service demonstrating the feature:

telnet lol.pm 12345

Here is how it looks like; this is PICO-8 (small window) launched from GNOME Terminal (large window) just after screenshot() was called:

And here is the code:

pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
-- screenshot to console
-- by sam hocevar

function screenshot()
 local l={ 16, 17, 89, 29, 131, 240, 251, 230, 197, 214, 220, 47, 39, 103, 211, 223 }
 local e="\027["
 printh(e.."?25l") -- hide cursor
 for y=0,63 do
  local ofg,obg=-1,-1
  local s=e..(y+1)..";1\072" -- uppercase h
  for x=0,127 do
   fg,bg,ch=pget(x,y*2),pget(x,y*2+1),"\226\150\128"
   if bg>fg then
    fg,bg,ch=bg,fg,"\226\150\132"
   end
   if fg!=ofg or bg!=obg then
    s=s..e
    local t=""
    if (bg!=obg) s,t=s.."48;5;"..l[bg+1],";"
    if (fg!=ofg) s=s..t.."38;5;"..l[fg+1]
    s=s.."m"
   end
   s=s..ch
   ofg,obg=fg,bg
  end
  printh(s..e.."0m"..e.."\075") -- uppercase k
 end
 printh(e.."?25h") -- show cursor
end

The terminal must be UTF-8 and 256-color aware, so this will probably work in most Linux and OS X terminals. On Windows I could test it successfully with the MSYS2 terminal.

P#29661 2016-09-29 08:15 ( Edited 2016-09-29 18:30)

[ :: Read More :: ]

Cart #27684 | 2016-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Will not work well on slow machines or in the web player.

I’m toying with both hi-color images (using 60Hz flickering) and data compression, this is my first attempt. The image size is 128×188.

The picture is of course a tribute to the Deluxe Paint series!

P#27685 2016-08-29 20:26 ( Edited 2016-08-30 01:12)